//
//  MineMsgCell.m
//  laowu
//
//  Created by 康苗 on 15/5/2.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "MineMsgCell.h"
#import "MineMsg.h"

@implementation MineMsgCell

-(instancetype)initWithTabelView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
    static  NSString  *CellIdentiferId = @"MineMsgCell";
    MineMsgCell  *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentiferId];
    if (cell == nil) {
        NSArray *nibs = [[NSBundle mainBundle]loadNibNamed:@"MineMsgCell" owner:nil options:nil];
        cell = [nibs firstObject];
          }
    return cell;
}

- (void)setMineMsg:(MineMsg *)mineMsg{
    _mineMsg = mineMsg;
    _time.text = mineMsg.data_time;
    _content.text = mineMsg.content;
    [_mineMsgView setCornerRadius:0 borderWidth:1 borderColor:HEXColor(@"#dfdfdf")];
    [self.selectBtn setSelected:mineMsg.selected];
}

- (IBAction)selectBtnClick:(id)sender {
    [self.selectBtn setSelected:!self.selectBtn.selected];
    [self.mineMsg setSelected:self.selectBtn.selected];
    if (!self.selectBtn.selected) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"unselected" object:nil];
    }
}
@end
